# Maintainer: Andrew Sun <adsun701@gmail.com>

_realname=pkg-config
pkgbase=mingw-w64-ruby-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-ruby-${_realname}")
pkgver=1.5.7
pkgrel=2
pkgdesc="Implementation of pkg-config in ruby (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/ruby-gnome2/pkg-config"
msys2_references=(
  'purl: pkg:gem/pkg-config'
)
license=('spdx:LGPL-2.1-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-ruby")
source=(https://rubygems.org/downloads/${_realname}-${pkgver}.gem)
noextract=(${_realname}-${pkgver}.gem)
sha256sums=('713671c6af034325dc7e7c12026b02570fbb1358d9f3a023d3a001ce0159b1c7')

package() {
  local _gemdir="$(ruby -e 'puts Gem.default_dir')"
  _gemdir="$(cygpath -u ${_gemdir})"
  
  gem install --ignore-dependencies --no-user-install --verbose \
    -i "${pkgdir}/${_gemdir}" -n "${pkgdir}${MINGW_PREFIX}/bin" \
    "${_realname}-${pkgver}.gem"
  
  rm "${pkgdir}/${_gemdir}/cache/${_realname}-${pkgver}.gem"
}
